#include "StdAfx.h"
#include "GameBrowserUtil.h"
#include "GameBrowserPanelManager.h"
#include "GameBrowserLeftPanel.h"
#include "GameBrowserTopPanel.h"



CGameBrowserPanelManager::CGameBrowserPanelManager(CMainFrame *pMainframe):m_pLeftPanel(NULL),m_pTopPanel(NULL)
{
	m_PMainFrame = pMainframe;

	m_pLeftPanel = new CGameBrowserLeftPanel();
	m_pTopPanel = new CGameBrowserTopPanel();
}

CGameBrowserPanelManager::~CGameBrowserPanelManager(void)
{
    if (m_pLeftPanel != NULL)
    {
        m_pLeftPanel->DestroyWindow();
        delete m_pLeftPanel;
        m_pLeftPanel = NULL;
    }
    if (m_pTopPanel != NULL)
    {
        m_pTopPanel->DestroyWindow();
        delete m_pTopPanel;
        m_pTopPanel = NULL;
    }
}
BOOL CGameBrowserPanelManager::CreatePanels()
{	
	if (m_pLeftPanel != NULL)
	{
		BOOL bLeft = m_pLeftPanel->CreateLeftPanel((CWnd*)m_PMainFrame,GM_PANEL_BEGIN_ID + 1);
		ASSERT(bLeft);
	}
	if(m_pTopPanel != NULL)
	{
		BOOL bTop = m_pTopPanel->CreateTopPanel((CWnd*)m_PMainFrame,GM_PANEL_BEGIN_ID + 2);
		ASSERT(bTop);
	}
	return TRUE;
}
void CGameBrowserPanelManager::MainFramRecalcLayout()
{

}
